import types
from functools import wraps

class TimeDecorator:
    def __init__(self, interval):
        self.interval = interval

    def __call__(self, func):
        @wraps(func)
        def wrapper(self, *args, **kwargs):
            return func(self, *args, **kwargs)

        # 关键：把 wrapper 转成“方法绑定描述符”
        wrapper._original = func
        return wrapper

if __name__ == "__main__":

    class Test:
        @TimeDecorator(3)
        def test(self):
            print("ccc")
            pass


    t = Test()
    t.test()
    t.test()
    t.test()
